package com.xinye.opengl

import android.annotation.SuppressLint
import android.app.ActivityManager
import android.content.Context
import android.os.Build




class CommonUtils {

}

fun isSupportGL20(context : Context) : Boolean{
    val am = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
    val config = am.deviceConfigurationInfo
    return config.reqGlEsVersion >= 0x2000
}


@SuppressLint("ObsoleteSdkInt")
fun isEmulator() : Boolean{
    val isEmulator = Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1
            && (Build.FINGERPRINT.startsWith("generic")
            || Build.FINGERPRINT.startsWith("unknown")
            || Build.MODEL.contains("google_sdk")
            || Build.MODEL.contains("Emulator")
            || Build.MODEL.contains("Android SDK built for x86"))

    return isEmulator
}

